package com.haibeimohe.boot;

import com.haibeimohe.client.RpcConsumer;
import com.haibeimohe.config.RpcRequest;
import com.haibeimohe.pojo.User;
import com.haibeimohe.service.IUserService;

/**
 * 客户端启动类
 * @author hassan
 */
public class ConsumerBoot {

    public static void main(String[] args) throws InterruptedException {
        RpcRequest rpcRequest = new RpcRequest();
        rpcRequest.setRequestId("userServiceImpl");
        IUserService service = (IUserService) RpcConsumer.createProxy(IUserService.class, rpcRequest);
        while (true) {
            User user = new User();
            user.setUsername("admin");
            user.setPassword("admin");
            String result = service.login(user);
            //String result = service.login("admin", "admin");
            System.out.println(result);
            Thread.sleep(2000);
        }
    }

}
